package com.cw.java8.builtInFunction;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * 消费者演示
 *
 */
public class MyConsumer {

    public static void main(String[] args) {
        // void accept(T t);
        Consumer<String> consumer = (String t) -> {
            int a = 10000;
            System.out.println(t + a);
        };

        consumer.accept("中国电信");


        BiConsumer<String, Integer> biConsumer = (String t, Integer u) -> {
            //对这两个数据进行操作即可，比如插入到数据库，或者是记录日志
            System.out.println(t + " --- " + u);
        };

        biConsumer.accept("中国移动", 10086);
    }
}
